package pack0812;

import java.util.Scanner;

public class Work4 {
    public static void main(String[] args) {
        //4：要求从键盘输入10个整数，然后对这10个数进行降序排序并输出。
        Scanner in = new Scanner(System.in);
        int[] array = new int[10];
        for(int i = 0; i<10; i++){
            System.out.print("请输入一个数字：");
            int a = in.nextInt();
            array[i] = a;
        }
        for(int i = 0; i<array.length-1; i++){
            for(int j = 0; j<array.length-1-i; j++){
                if(array[j+1]>array[j]){
                    int a = array[j];
                    array[j] = array[j+1];
                    array[j+1] = a;
                }
            }
        }
        for(int i = 0; i<array.length; i++){
            System.out.print(array[i]+"\t");
        }
    }
}
